/*
 * @Author: your name
 * @Date: 2022-04-12 19:14:42
 * @LastEditTime: 2022-04-12 22:49:23
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /safe_transmission_platform/src/codecFactory.h
 */
#ifndef __DANIEL_CODECFACTORY_H__
#define __DANIEL_CODECFACTORY_H__

#include "codec.h"
#include <memory>
namespace daniel
{
    class Factory
    {
    public:
        using ptr=std::shared_ptr<Factory>;
        Factory(){};
        virtual Codec* createObject()=0;
        virtual ~Factory(){};
    };
    class RequestFactory:public Factory
    {
    public:
        RequestFactory(const RequestInfo& reqInfo):m_reqInfo(reqInfo)
        {};
        RequestFactory(const std::string& str):m_encodeStr(str)
        {};
        virtual Codec* createObject() override;
        virtual ~RequestFactory(){};
    private:
        RequestInfo m_reqInfo;
        std::string m_encodeStr;
    };

    class ResponseFactory:public Factory
    {
    public:
        ResponseFactory(const RespondInfo& respondInfo):m_respondInfo(respondInfo)
        {}
        ResponseFactory(const std::string& str):m_encodeStr(str)
        {}
        virtual Codec* createObject() override;
        virtual ~ResponseFactory(){};
    private:
        RespondInfo m_respondInfo;
        std::string m_encodeStr;
    };
}

#endif